$def with (ogtxml, know)
$ nofiles = ['PlainText', 'FormalizedText', 'FormattedText', 'Demonstration']
$ allfiles = ['Image', 'Audio', 'Video']
$ allforms = ogtxml.getResourceForms(know)
$ nofilesspe = [k for k in nofiles if k in allforms.keys()]
$ allfilesspe = [k for k in allfiles if k in allforms.keys()]

<div role="article" class="coursera-body">
	<div class="container">
		<div class="coursera-full-canvas">
			<div class="row-fluid">
				<div class="span12">
					<div style="margin-bottom: 10px;" class="heading-banner">
						<h1>Adding $know<small id="coursera-profile-editor-status"
								style="font-size: 12px; line-height: 12px;"></small>
						</h1>
					</div>
				</div>
			</div>
			<div class="row-fluid">
				<div class="span12">
					<div>
						<h3>Annotations</h3><br/>
					</div>
					<form id="coursera-profile-editor-form"
						action="/knowledgeman"
						enctype="multipart/form-data" method="POST"
						class="form-horizontal">
						$for i,j in ogtxml.getAnnotationForms(know).items():
							<div class="control-group">
							<label class="control-label">$i</label>
							<div class="controls">
							$if j == "text":
								$if i == "Name":
									<input type="text" name="$i" id="knows-equiv-name">
									<input type="hidden" name="knowid" value="0" id="knows-equiv-knowid">
									<a tabindex="0" id="knows-equiv-pop" data-ajax="0" data-open="0" know-type="$know"><span>&nbsp;equivalent to</span>
									<span>&nbsp;▾</span></a>&nbsp;&nbsp;<span id="knows-equiv-tips-1"></span>
									<div id="knows-equiv-pop-div" style="border:1px dotted black; width:500px; display:none; padding:4px; margin-top:2px;">
									<h4>choose the same knowledge <font color="#ff0000">$know</font> already exist</h4>
									<p><select id="knows-equiv-values" style="width:180px;">
										<option value="notexists">not exists in db</option>
										</select><span>&nbsp;</span><input id="knows-equiv-submit" type="button" value="select" class="btn btn-primary knowledge-rating-level"/>
										<span id="knows-equiv-tips">Be Careful</span>
									</p>
									</div>
								$else:
									<input type="text" name="$i">
							$elif j == "textarea":
								<textarea name="$i" style="width: 600px;" class="large"></textarea>
							</div>
							</div>
						<br/>
						$if nofilesspe != []:
							<hr class="coursera-full-page-divider-no_padding">
						$for m in nofilesspe:
							$ n=allforms.get(m)
							<div><h3>Add $m</h3><br/></div>
							$for i,j in n.items():
								<div class="control-group">
								<label class="control-label">$i</label>
								<div class="controls">
								$if j == "text" or j == "datetime" or j == "int":
									<input type="text" name="$m$i">
								$elif j == "textarea":
									$if m == "FormattedText":
										<textarea name="$m$i" style="width: 600px;" class="ckeditor"></textarea>		
									$else:
										<textarea name="$m$i" style="width: 600px;" class="large"></textarea>
								$elif j == "file":
									<input type="file" name="$m$i" class="image-selector-input">
								$elif j == "option":
									<select name="$m$i" style="width: 120px;">
										$for k in ogtxml.equivalentOptions(i):
											<option value="$k">$k</option>
									</select>
								</div>
								</div>
							<br/>
						$if allfilesspe != []:
							<hr class="coursera-full-page-divider-no_padding">
						$for m in allfilesspe:
							$ n=allforms.get(m)
							<div><h3>Add $m</h3><br/></div>
							$for i,j in n.items():
								<div class="control-group">
								<label class="control-label">$i</label>
								<div class="controls">
								$if j == "text" or j == "datetime" or j == "int":
									<input type="text" name="$m$i">
								$elif j == "textarea":
									$if m == "FormattedText":
										<textarea name="$m$i" style="width: 600px;" class="ckeditor"></textarea>		
									$else:
										<textarea name="$m$i" style="width: 600px;" class="large"></textarea>
								$elif j == "file":
									<input type="file" name="$m$i" class="image-selector-input">
								$elif j == "option":
									<select name="$m$i" style="width: 120px;">
										$for k in ogtxml.equivalentOptions(i):
											<option value="$k">$k</option>
									</select>
								</div>
								</div>
							<br/>
						<div class="control-group">
							<div class="controls">
								<button type="submit"
									class="coursera-save-button btn btn-primary">Save $know</button>
							</div>
						</div>
						<input type="hidden" name="lev1" value="1">
						<input type="hidden" name="know" value="$know">
					</form>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
window.onload=knowledgeman_onload;
</script>